extends c

snippet be "$1.begin(), $1.end() (be)"
${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
endsnippet

snippet using "using namespace (using)"
using namespace ${1:std};
endsnippet

snippet us "using (us)"
using $1;
endsnippet

snippet pair "std::pair (pair)"
std::pair<${1:key}, ${2:value}> $0;
endsnippet

snippet map "std::map (map)"
std::map<${1:key}, ${2:value}> $0;
endsnippet

snippet vector "std::vector (v)"
std::vector<${1:unsigned}> $0;
endsnippet

snippet list "std::map (map)"
std::list<${1:unsigned}> $0;
endsnippet

snippet class "class (class)"
class ${1:`!p snip.rv = snip.basename or "name"`} {
 public:
  ${1/(\w+).*/$1/}(${2:arguments});
  virtual ~${1/(\w+).*/$1/}();

 private:
  ${0:/* data */}
};
endsnippet

snippet ns "namespace (ns)"
namespace $1 {
${VISUAL}$0
}  // namespace $1
endsnippet

snippet fore "foreach (fore)"
for (const auto &${1:v} : $2) {
  ${VISUAL}$0
}
endsnippet

# vim:ft=snippets:
